package lab02.test29;

/**
 * Created by JAVA on 2017/11/3.
 */
public class Test {
    public static void main(String[] args) {
        int [] numbers=new int[5];
        numbers [0]=13;
        numbers [1]=13;
        numbers [2]=13;
        numbers [3]=13;
        numbers [4]=13;

        try{
            //有可能出错的
            System.out.println(numbers[5]);
        }catch (ArrayIndexOutOfBoundsException e){
            //1.出什么错误
            //2.出错了怎么处理
            System.out.println("数组下标越界");
        }finally {
            //不管如何最终都会执行的代码
            System.out.println("最终都会执行的代码");
        }
    }
}
